<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:MissedMemo.MeatAndCheeseDisc.OrderMonitor" >
    
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="resColorScheme.xaml" />
    </ResourceDictionary.MergedDictionaries>
    
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

    <local:ElapsedTimeToColorConverter x:Key="ElapsedTimeToColorConverter"
           OrderOnScheduleColor="{StaticResource brushOrderBorder}"
           OrderOnScheduleSelectedColor="{StaticResource brushSelectedOrderBorder}"
           OrderScheduleWarningColor="{StaticResource brushElapsedTimeWarning}"
           OrderScheduleOverdueColor="{StaticResource brushElapsedTimeError}" />

    <local:ElapsedTimeToBorderWidthConverter x:Key="ElapsedTimeToBorderWidthConverter"
           OrderOnScheduleWidth="2"
           OrderOnScheduleSelectedWidth="1"
           OrderScheduleWarningWidth="3" />

    <Style x:Key="DefaultKitchenOrderStyle" TargetType="Border" >
        <Setter Property="Background" Value="{StaticResource brushOrderBackground}" />
        <Setter Property="BorderBrush" Value="{Binding Timer.ElapsedTime,
            Converter={StaticResource ElapsedTimeToColorConverter}, ConverterParameter=false}" />
        <Setter Property="BorderThickness" Value="{Binding Timer.ElapsedTime,
            Converter={StaticResource ElapsedTimeToBorderWidthConverter}, ConverterParameter=false}" />
        <Setter Property="CornerRadius" Value="8" />
    </Style>
        
    <Style x:Key="SelectedKitchenOrderStyle" TargetType="Border" >
        <Setter Property="Background" Value="{StaticResource brushSelectedOrderBackground}" />
        <Setter Property="BorderBrush" Value="{Binding Timer.ElapsedTime,
            Converter={StaticResource ElapsedTimeToColorConverter}, ConverterParameter=true}" />
        <Setter Property="BorderThickness" Value="{Binding Timer.ElapsedTime,
            Converter={StaticResource ElapsedTimeToBorderWidthConverter}, ConverterParameter=true}" />
        <Setter Property="CornerRadius" Value="12" />
    </Style>
    
    <Style x:Key="PizzaOptionBorderStyle" TargetType="Rectangle" >
        <Setter Property="RadiusX" Value="6" />
        <Setter Property="RadiusY" Value="6" />
        <Setter Property="Stroke" Value="{StaticResource brushPizzaOptionsBorder}" />
    </Style>
    
    
    <Style x:Key="CancelAnnotationStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource brushCancelAnnotation}" />
        <Setter Property="FontSize" Value="24" />
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="Visibility" Value="{Binding IsCancelled, Converter={StaticResource BooleanToVisibilityConverter}}" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="RenderTransform">
            <Setter.Value>
                <RotateTransform CenterX="0" CenterY="0" Angle="-25" />
            </Setter.Value>
        </Setter>
    </Style>
    
       
    <Style x:Key="CloseButtonStyle" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Ellipse Name="Ellipse" Fill="{StaticResource brushCloseButtonBackground}"
                                 Stroke="{StaticResource brushCloseButtonOutline}" StrokeThickness="2" />
                        <TextBlock Text="X" FontSize="14" FontWeight="Bold" Foreground="{StaticResource brushCloseButtonText}"
                                   TextAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource brushCloseButtonHighlight}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
</ResourceDictionary>